<?php

/**
 * MVM_MALL 网上商店系统  文章公共文件
 * ============================================================================
 * 版权所有 (C) 2007-2010 www.mvmmall.com，并保留所有权利。
 * 网站地址: http://www.mvmmall.com
 * ----------------------------------------------------------------------------
 * 这是一个免费开源的软件；这意味着您可以在不用于商业目的的前提下对程序代码
 * 进行修改、使用和再发布。
 * ============================================================================
 * $Author:  www.mvmmall.com  $
 * $Date: 2008-02-27 $
 * $Id: board_comm.inc.php  www.mvmmall.com$
 * ---------------------------------------------
*/

if (!defined('MVMMALL')) {
    exit('Access Denied');
}

empty($action) && show_msg($lang[pass_worng]);
$action = dhtmlchars($action);
$mm_board = $db->get_one("SELECT * FROM `{$tablepre}badmin_table` WHERE board_name_code = '$action'");
empty($mm_board[uid]) && show_msg('db_avess');

//文章内容
if(is_numeric($id)){
    $article = false;
    $article = $db->get_one("SELECT * FROM `{$tablepre}bmain` WHERE uid='$id' ORDER BY `headnum` ASC ");
    empty($article[uid]) && show_msg($lang[db_avess]);
}

//文章小分类
if($mm_board['use_category'] == '1') {
	$board_array = array();
	$show_category = false;
    $board_array =  $cache->get_cache('board_cat');
    if ($board_array) {
    	foreach ($board_array as $val) {
    		if ($val['ps_name'] == $action) {
    			$show_selected = $val['uid'] == $article['board_category'] ? 'selected': '';
    			$show_category .= "<option value='$val[uid]' $show_selected > $val[category_name] </option>";
    			$show_category_array[$val['uid']] = $val['category_name'];
    		}
    	}
    	$show_category_array &&  $show_category = "<select size='1' name='board_category'>".$show_category."</select>";
    }
}
